package question16;

public class ExceptionDemo {
    public static void main(String[] args) {
        int[] ints = new int[0];
        System.out.println(getMax(ints));
    }
    public static int getMax(int[] ints){
        int max=0;
        if (ints==null){
            throw new NullPointerException("数组不能为空");
        }else{
            //if ()
            for (int i = 0; i < ints.length; i++) {
                max=Math.max(max,ints[i]);
            }
        }
        return max;
    }
}
